/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __4D3F9323_C198_40d4_8638_4FB042C92B3A__
#define __4D3F9323_C198_40d4_8638_4FB042C92B3A__

#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos_common
{

    class sha_impl : public xos_stl::mem_item< xos::release_impl< sha_impl >, thread_lock >,
		public i_sha
    {
    public:
        typedef xos::release_impl< sha_impl > T;

    public:
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //

        static int get_xos_item_data( ITEM_DATA*& item_ptr );

    public:
        sha_impl();
        ~sha_impl();

    protected:
        void * m_pCtx;

    public:
        int init();
        int term();

    public:
        int cal_sha( const char * lpszBuf, int nLen );
        int get_sha( char * lpszBuf, int nLen );

    };
} // xos_common

#endif // __4D3F9323_C198_40d4_8638_4FB042C92B3A__
